import { ICondition } from '../../interfaces';
import service from './service';

/**
 * drools自定义服务
 * @param systemid 项目的systemid
 * @param refsystemid 项目的多个库systemid
 * @param service_name 服务名
 * @param condition 条件
 * @param cache 是否缓存
 * @param force_update_cache 是否即时刷新缓存
 */
export default async function drools(systemid: string, refsystemid: string, service_name: string, condition: ICondition, cache: boolean, force_update_cache: boolean) {
	const param = {
		condition: condition || {
			paging: {
				index: 1,
				size: 12
			},
			param: {},
			sort: {}
		},
		modelid: 'custom::drools_' + service_name,
		refsystemid,
		systemid
	};
	return await service('dataservice.drools', param, cache, force_update_cache);
}
